#include <iostream>
#include <forward_list>
using namespace std;

int main_6()
{
    forward_list<int> for_list({1,2,3,4,5});
    forward_list<int> for_list1({5,-3,7});
    auto pos=++for_list.begin();
    for_list.insert_after(pos,3,-2);
    for(auto val:for_list)
    {
        cout << val << " ";
    }
    cout << endl;
    pos=for_list.insert_after(pos,for_list1.begin(),for_list1.end());
    for (forward_list<int>::iterator it=for_list.begin(); it!=for_list.end() ; ++it )
    {
        cout << *it << " ";
    }
    cout << endl;
    for_list.erase_after(pos);
    for (auto it=for_list.begin(); it!=for_list.end() ; ++it )
    {
        cout << *it << " ";
    }
    cout << endl;
    for_list1.reverse();
    for (auto it=for_list1.begin(); it!=for_list1.end() ; ++it )
    {
        cout << *it << " ";
    }
    cout << endl;
    for_list1.sort(greater<int>());
    for (auto it=for_list1.begin(); it!=for_list1.end() ; ++it )
    {
        cout << *it << " ";
    }
    return 0;
}
